#ifndef SETTINGSMANAGER_H
#define SETTINGSMANAGER_H
#include <QStringList>
#include "settingitem.h"
#include "htmlbuilder.h"

//Singleton
class SettingsManager : public HtmlBuilder
{
    QStringList m_recentProjects;
    QStringList m_openedTabs;
    QString m_lastProject;
    QString m_currentTab;
    QString m_CSS;
    QString m_filter;

    QHash<QString, SettingItem> m_settingsStore;
    QHash<QString, QString> m_settingCaptions;
    QStringList m_fontsCategory;
    QStringList m_editorCategory;
    QStringList m_completionCategory;

    SettingsManager();
    SettingsManager(SettingsManager const&){};
    SettingsManager& operator=(SettingsManager const&){return *this;};
    static SettingsManager* m_instance;

public:
    static SettingsManager* Instance();
    //SettingsManager();
    QStringList & getRecentProjects();
    void addRecentProject(QString aProject);
    void removeRecentProject(QString aProject);
    void load();
    void save();
    QString getLastProject();
    void setOpenedTabs(QStringList &aTabs);
    void getTabs(QStringList &aTabs);
    void setCurrentTab(QString aTab);
    QString getCurrentTab();
    void addSetting(SettingItem aSetting, QString aCaption, QString aCategory);
    SettingItem & getSetting(QString aKey);
    void setFilter(QString aFilter);
    void addContent(QStringList &aHtml);
};

#endif // SETTINGSMANAGER_H
